﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Shell;
using ManagesMoney.Resources;
using Coding4Fun.Phone.Controls;
using Microsoft.Phone.Controls;
using System.Windows.Input;

namespace ManagesMoney
{
    public partial class MainPage : PhoneApplicationPage
    {
        private string Message;
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }

        // Load data for the ViewModel Items
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (!App.ViewModel.IsDataLoaded)
            {
                App.ViewModel.LoadData();
            }
        }

        private void anUong_Tap_1(object sender, RoutedEventArgs e)
        {
           
            InputPrompt MyIP1 = new InputPrompt();
            MyIP1.Completed += new EventHandler<PopUpEventArgs<string, PopUpResult>>(input_complete);
            MyIP1.Title = "ĐỒ ĂN";
            MyIP1.Message = "Số tiền:";
            MyIP1.InputScope = new InputScope
            {
                Names = 
                {
                    new  InputScopeName()
                    {
                        NameValue = InputScopeNameValue.CurrencyAmount
                    }
                }
            };
            MyIP1.Show();
            InputPrompt MyIP2 = new InputPrompt();
            MyIP2.Completed += new EventHandler<PopUpEventArgs<string, PopUpResult>>(input_complete);
            MyIP2.Title = "ĐỒ ĂN";
            MyIP2.Message = "Lý do: ";
            MyIP2.InputScope = new InputScope
            {
                Names = 
                {
                    new InputScopeName()
                    {
                        NameValue = InputScopeNameValue.Text
                    }
                }
            };
            MyIP2.Show();
        }

        private void input_complete(object sender, PopUpEventArgs<string, PopUpResult> e)
        {
            //throw new NotImplementedException();
        }

        private void makeUp_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {
            
        }

        private void hocTap_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {

        }

        private void quaCap_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {

        }

        private void quanAo_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {

        }

        private void giaiTri_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {

        }

        private void diLai_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {

        }

        private void vatNuoi_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {

        }

        // Sample code for building a localized ApplicationBar
        //private void BuildLocalizedApplicationBar()
        //{
        //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
        //    ApplicationBar = new ApplicationBar();

        //    // Create a new button and set the text value to the localized string from AppResources.
        //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
        //    appBarButton.Text = AppResources.AppBarButtonText;
        //    ApplicationBar.Buttons.Add(appBarButton);

        //    // Create a new menu item with the localized string from AppResources.
        //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
        //    ApplicationBar.MenuItems.Add(appBarMenuItem);
        //}
    }
}